﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Info_SpecialForm.aspx.cs" Inherits="FS.Web.BLL.Visa_Base.Info_SpecialForm" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>   
    <meta charset="UTF-8"> 
    <meta http-equiv="X-UA-Compatible" content="IE=8" /><!--以IE8模式渲染--> 
    <link href="/Themes/Scripts/EasyUI/easyui.css" rel="stylesheet" type="text/css" />
    <link href="/Themes/Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/Validator/JValidator.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/artDialog/artDialog.source.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/artDialog/iframeTools.source.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/FunctionJS.js" type="text/javascript"></script>    
    <script src="/Themes/Scripts/EasyUI/jquery.easyui.min.js" type="text/javascript"></script> 
    <script type="text/javascript">        
        //删除
        function FDel() {
            var key = CheckboxValue();
            if (IsDelData(key)) {
                $("#HDetailID").val(key);
            }
        }

        //添加客户
        function FAdd() {
            GetValueCerttype();
            GetValueCoutry();
            GetValueSupply();
            var cprice = $('#select_Cprice').val();
            var sprice = $('#select_Sprice').val();
            if (!isDouble(cprice))
            {
                alert("请维护签证金额");
                return false;
            }
            if (!isDouble(sprice)) {
                alert("请维护供应商报价");
                return false;
            }
        }

        //
        function FSave()
        {
            GetValueCustomer();
            return CheckDataValid('#form1');
        }

        function GetValueCoutry(){
            $('#HCountryid').val($('#select_country').val());           
        }

        function GetValueCerttype() {
            var v_name = $('#select_certtype').combobox('getText');
            var v_id = $('#select_certtype').combobox('getValue');
            if (v_id == undefined) {
                v_id = "s";
            }
            $('#HCertTypeID').val(v_id);
            $('#HCertTypeName').val(v_name);
        }

        function GetValueSupply() {
            var v_name = $('#select_supply').combobox('getText');
            var v_id = $('#select_supply').combobox('getValue');
            if (v_id == undefined) {
                v_id = "s";
            }
            $('#HSupplyID').val(v_id);
            $('#HSupplyName').val(v_name);
        }

        function GetValueCustomer() {
            var v_name = $('#trust_id').combobox('getText');
            var v_id = $('#trust_id').combobox('getValue');
            if (v_id == undefined) { v_id = "s"; }
            $('#HCustomerid').val(v_id);
            $('#HCustomerName').val(v_name);
        }

        function ChangeCerttype() {
            GetValueCerttype();

            var cityid = $('#HCountryid').val();
            var certtype = $('#HCertTypeID').val();
            if (cityid != "s" & certtype!="s") {
                var parm = 'action=GetPriceFromCityCert&cityid=' + escape(cityid) + '&certtype=' + escape(certtype)
                getAjax('base.ashx', parm, function (rs) {
                    try {
                        $("#detail_begmoney").val(rs);
                    } catch (e) {
                    }
                });
            }
        }                

        function ChangeSupply() {
            GetValueSupply();

            var supplyid = $('#HSupplyID').val();
            var cityid = $('#HCountryid').val();
            var certtype = $('#HCertTypeID').val();
            if (cityid != "s" & certtype != "s" & supplyid != "s") {
                var parm = 'action=GetPriceFromSupply&cityid=' + escape(cityid) + '&certtype=' + escape(certtype) + '&supplyid=' + escape(supplyid)
                getAjax('base.ashx', parm, function (rs) {
                    try {
                        $("#select_Sprice").val(rs);
                    } catch (e) {
                    }
                });
            }
        }       
        
    </script>
</head>
<body>    
    <form id="form1" runat="server">
    <input id="Hinfo" type="hidden" runat="server"/>      
    <input id="HDetailID" type="hidden" runat="server"/>
    <input id="HCountryid" type="hidden" runat="server"/>
    
    <input id="HCertTypeID" type="hidden" runat="server"/>
    <input id="HCertTypeName" type="hidden" runat="server"/>
    <input id="HSupplyID" type="hidden" runat="server"/>
    <input id="HSupplyName" type="hidden" runat="server"/>
    <input id="HCustomerid" type="hidden" runat="server"/>
    <input id="HCustomerName" type="hidden" runat="server"/>
               
    <table border="0" cellpadding="0" cellspacing="0" class="frm"> 
        <tr>
            <th>
                收签时间：
            </th>
            <td>
               <input id="info_getdate" runat="server" type="text" class="txt" 
                     style="width: 200px" onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd' })" />
            </td>
            <th >
                备注：
            </th>
            <td >
                <textarea id="info_remark" class="txtRemark" runat="server" style="width:95%;height:50px;"></textarea>
            </td>       
        <tr>
            <td colspan="4">
            <div class="btnbarcontetn">                   
                <div> 添加客户信息                    
                 </div>
            </div>      
            <div id="detail_input" >
                <table border="0" cellpadding="0" cellspacing="0" id="table_detail" style="width:100%" >                
                <tr>
                    <th >
                        签证国家：
                    </th>
                    <td >
                        <select id="select_country" runat="server" class="select" style="width:120px" onchange="GetValueCoutry()" />                                               
                    </td>
                    <th >
                        签证类型：
                    </th>
                    <td >
                        <select id="select_certtype" runat="server" class="easyui-combobox" style="width:120px" 
                            data-options="onSelect:function(rec){ChangeCerttype();}"/> 
                    </td>
                    <th >
                        签证金额：
                    </th>
                    <td >
                        <input id="select_Cprice" runat="server" type="text" class="txt" style="width:120px" /></td>
                </tr>
                <tr>
                    <th >
                        供应商：
                    </th>
                    <td>
                        <select id="select_supply" runat="server" class="easyui-combobox" style="width:120px"  
                            data-options="onSelect:function(rec){ChangeSupply();}"/>                                               
                    </td>
                    <th >
                        供应商报价：
                    </th>
                    <td >
                        <input id="select_Sprice" runat="server" type="text" class="txt" style="width:120px" /></td>
                    <td >
                        &nbsp;</td>
                    <td >
                        &nbsp;</td>
                </tr>
                <tr> 
                    <th>
                        客户姓名：
                    </th>                                                         
                    <td colspan="3">
                        <textarea id="detail_customer" class="txtRemark" runat="server" style="width:98%;height:40px;"></textarea>                      
                    </td>  
                    <td>
                        &nbsp;
                        <asp:LinkButton ID="lbtadd" runat="server" class="button green" OnClientClick="return FAdd()" OnClick="lbtadd_Click" >
                            <span class="icon-botton"  style="background: url('/Themes/images/16/add.png') no-repeat scroll 0px 4px;">
                            </span>添 加
                        </asp:LinkButton>                        
                        </td>  
                    <td>
                        &nbsp;<asp:LinkButton ID="lbtdel" runat="server" class="button green" OnClientClick="FDel()" OnClick="lbtdel_Click" >
                            <span class="icon-botton"  style="background: url('/Themes/images/16/delete.png') no-repeat scroll 0px 4px;">
                            </span>删 除</asp:LinkButton>                      
                    </td>  
                </tr>
                </table>                                              
            </div>
           <div id ="detailsub1" style="height:230px; overflow:auto; ">
                <table id="table1" class="example" singleselect="true">
                    <thead>
                        <tr>
                            <td style="width: 20px; text-align: left;">
                                <label id="checkAllOff" onclick="CheckAllLine()" title="全选">
                                    &nbsp;</label>
                            </td> 
                            <td style="width: 100px; text-align: center;">
                                签证国家
                            </td> 
                            <td style="width: 80px; text-align: center;">
                                签证类型
                            </td>
                            <td style="width: 100px; text-align: center;">
                                供应商
                            </td>
                            <td style="width: 80px; text-align: center;">
                                费用
                            </td>
                            <td style="width: 100px; text-align: center;">
                                客户姓名
                            </td>
                        </tr>
                    </thead>
                    <tbody>                        
                        <asp:Repeater ID="rp_Item" runat="server">
                            <ItemTemplate>
                                <tr>
                                    <td style="width: 20px; text-align: left;">
                                        <input type="checkbox" value="<%#Eval("infodetail_id")%>" name="checkbox" />
                                    </td>                            
                                    <td style="width: 100px;">
                                        <%#Eval("city_name")%>
                                    </td> 
                                     <td style="width: 80px;">
                                        <%#Eval("property_value")%>
                                    </td>
                                    <td style="width: 100px;">
                                        <%#Eval("Supply_Name")%>
                                    </td> 
                                    <td style="width: 80px;">
                                        <%#Eval("InfoDetai_BegPrice")%>       
                                    </td>
                                    <td style="width: 100px;">
                                        <%#Eval("InfoDetail_user")%>
                                    </td>                   
                                </tr>                                
                            </ItemTemplate>
                            <FooterTemplate>
                                <% if (rp_Item != null)
                                   {
                                       if (rp_Item.Items.Count == 0)
                                       {
                                           Response.Write("<tr><td colspan='6' style='color:red;text-align:center'>没有找到您要的相关数据！</td></tr>");
                                       }
                                   } %>
                            </FooterTemplate>
                        </asp:Repeater>                       
                    </tbody>
                </table>
            </div> 
            </td>
        </tr>
        <tr>
            <th>
                委托方：
            </th>
            <td>               
                &nbsp;<select id="trust_id" runat="server" class="easyui-combobox" style="width:206px"  
                            data-options="onSelect:function(rec){GetValueCustomer();}" name="D1"/>                            
            </td>
             <th>
                 
                 业务员：</th>
            <td>
                 <input id="info_operation" runat="server" type="text" class="txt" style="width: 200px" />
            </td>
        </tr>
        <tr>
            <th>
                人数：
            </th>
            <td>               
                <input id="info_outpeople" runat="server" type="text" disabled="disabled" class="txt" datacol="yes" err="人数"
                    checkexpession="Num" style="width: 200px" value="0" />
            </td>
             <th>
                 费用合计：
            </th>
            <td>
               <input id="info_outmoney" runat="server" type="text" disabled="disabled" class="txt" datacol="yes" err="取件费用"
                    checkexpession="DoubleOrNull" style="width: 200px" value="0" />
            </td>
        </tr>
        <tr>
            <th>
                应收金额：</th>
            <td>               
                <input id="info_moneyin" runat="server" type="text" class="txt" datacol="yes" err="应收金额"
                    checkexpession="DoubleOrNull" style="width: 200px" /></td>
             <th>
                应付金额：</th>
            <td>
                <input id="info_moneyout" runat="server" type="text" class="txt" datacol="yes" err="应收金额"
                    checkexpession="DoubleOrNull" style="width: 200px" /></td>
        </tr>
        </table>
    <div class="frmbottom">
        <asp:LinkButton ID="Save" runat="server" class="l-btn" OnClientClick="return FSave()"
            OnClick="Save_Click"><span class="l-btn-left">
            <img src="/Themes/Images/save.png" alt="" />保 存</span></asp:LinkButton>
        <a class="l-btn" href="javascript:void(0)" onclick="OpenClose();"><span class="l-btn-left">
            <img src="/Themes/Images/cancel.png" alt="" />关 闭</span></a>       
    </div>
    </form>
</body>
</html>